<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Sistema Desenvolvido por Robson Miranda
Design by Robson Miranda
binho_256@globo.com
-->
<?php $mensageiro->upDate($loggedUser["id"],$loggedUser["sysEmpresas_id"]); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
        <title>SCR - Base de testes</title>

        <?php
        echo $html->stylesheet("default_main.css");
        echo $html->stylesheet("jquery.cluetip.css");
        echo $html->stylesheet("/themes/flick/jquery.ui.all.css");
        echo $html->script("jquery.js");
        echo $html->script("funcoes");
        echo $html->script("meio-mask.js");
        echo $html->script("ui/jquery-ui-1.8.5.custom.js");
        echo $html->script("validate.js");
        echo $html->script("jquery.cluetip.js");
        echo $html->script("regras.validate.js");
        echo $html->script("jquery.form.js");
        //pr($loggedUser);
        ?>
        <script type="text/javascript">
            $(function() {
                $("button,.botao, input:submit, input:button, button", "html").button();
                $("input:text").setMask();

                $("#janelaModal").dialog({
                    autoOpen: false,
                    modal:true,
                    height:500,
                    width:465
                });

                $('#avisoSistema').dialog({
                    autoOpen: false,
                    width: 350,
                    height:100,
                    title:"Aviso do Sistema",
                    modal: true,
                    buttons: {
                        "Ok": function() {
                            $(this).dialog("close");
                        }
                    }
                });

                $.ajaxSetup ({
                    cache: false
                });
            });

        </script>       
        <meta NAME="Author" CONTENT="Robson Miranda Alves de Oliveira, a serviço da Assistec Informatica"/>
    </head>
    <body>
        <div id="wrapper">
            <div id="header">
                <div id="logo">
                    <?php echo $html->imageLink("logoHeader.png", "/", array("border" => "0")); ?>
                </div>
            </div>
            <!-- end #header -->
            <div class="menu">
                <?php echo $this->element("/gadgets/menu"); ?>
                </div>
                <!-- end #menu -->
                <div id="page">
                    <div id="page-bgtop">
                        <div id="page-bgbtm">
                            <div id="content" class="borda ui-corner-all">
                            <?php echo $this->contentForLayout; ?>
                        </div>
                        <!-- end #content -->
                        <div id="sidebar">
                            <script type="text/javascript">
                                var auto_refresh = setInterval(
                                function ()
                                {
                                    $('#mensageiro').load('/mensageiro/mensageiro');
                                }, 5000); //refresh every 10000 milliseconds
                            </script>
                            <?php
                            echo $this->element("/gadgets/avisos", array("setor" => $loggedUser["rh_setor_id"]));
                            echo $this->element("/gadgets/logado", array("dadoFunc" => $loggedUser, "pathSistema" => "/var/www/sistemas/scr/app"));
                            if ($loggedUser["permissao"] == 1) {
                                echo $this->element("/gadgets/mensageiro", array("usuario" => $loggedUser["id"], "funcionarios" => $funcionariosCad,"empresa"=>$loggedUser["sysEmpresa_id"]));
                            }
                            if ($loggedUser["permissao"] == 1 or $loggedUser["permissao"] == 2) {
                                echo $this->element("/gadgets/statusRh",array("grupoEmpresa"=>$loggedUser["grupoEmpresa_id"]));
                            }
                            if ($loggedUser["permissao"] == 1 or $loggedUser["permissao"] == 3) {
                                echo $this->element("/gadgets/statusFinanceiro");
                            }
                            ?>

                        </div>
                        <!-- end #sidebar -->
                        <div style="clear: both;">&nbsp;</div>
                    </div>
                </div>
            </div>
            <!-- end #page -->
        </div>
        <div id="footer">
            <p>Assistec Informática<br/>
                Suporte: <a href="mailto:desenvolvimento@assistecinformatica.com.br">desenvolvimento@assistecinformatica.com.br</a>
            </p>
        </div>
        <div id="janelaModal"></div>
        <div id="avisoSistema">
            <?php
                            if (!empty($mensagens) || $mensagens = Session::flash("Auth.error")) {
                            echo $mensagens;
            ?>
                                <script type="text/javascript" >                   
                                    $("#avisoSistema").dialog("open");
                                </script>                    
            <?php
                            }
            ?>            
        </div>

        <!-- end #footer -->
    </body>
</html>
